// 封装一个时间获取
const getTime = () => {
  // 通过内置构造函数拿到时间
  const hours = new Date().getHours()
  let text = ''
  if (hours <= 9) {
    text = '早上'
  } else if (hours <= 11) {
    text = '上午'
  } else if (hours <= 13) {
    text = '中午'
  } else if (hours <= 18) {
    text = '下午'
  } else {
    text = '晚上'
  }
  return text
}
export default getTime
